package com.ricervcvcer.category.mapper;

import com.ricervcvcer.category.entity.TbCategory;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 商品类目表，类目和商品(spu)是一对多关系，类目与品牌是多对多关系 Mapper 接口
 * </p>
 *
 * @author moge
 * @since 2022-01-05
 */
public interface TbCategoryMapper extends BaseMapper<TbCategory> {

    /*
    * 根据分类主键查询对应的品牌主键
    * */
    @Select("select brand_id from tb_category_brand where category_id = #{categoryId}")
    List<Long> selectBrandIdsByCategoryId(@Param("categoryId") Long categoryId);
}
